<?php

namespace App\Requests\Api\UserCard;

use Illuminate\Foundation\Http\FormRequest;

/**
 * 新增字段校验
 * Class StoreRequest
 * @package App\Requests\Api\UserCard
 */
class StoreRequest extends FormRequest {
    public function authorize()
    {
        return true;
    }

    public function rules()
    {
        return [
            'card_id'    => 'required|integer',
            'course_id'    => 'required|integer',
            'openid'   => 'required',
        ];
    }

    public function messages()
    {
        return [
            'card_id.required'    => 'card_id id required',
            'card_id.integer'    => 'card_id is integer',
            'openid.required'       => 'openid id required',
            'course_id.required'  => 'course_id id required',
            'course_id.integer'  => 'course_id id integer',
        ];
    }
}